package com.pureut.system.api.factory;

import com.pureut.common.core.domain.R;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.system.api.SystemDocumentFeignService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: YSL
 * @Date: 2023/1/12 16:25
 * @Desc: 用户服务降级处理
 */
@Component
public class SystemDocumentFallbackFactory implements FallbackFactory<SystemDocumentFeignService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);

    @Override
    public SystemDocumentFeignService create(Throwable throwable) {

        log.error("单据配置调用失败:{}",throwable.getMessage());
        return new SystemDocumentFeignService() {


            @Override
            public AjaxResult getInfoDocumentConfigById(Long docConfig) {
                return null;
            }
        };
    }
}
